<!DOCTYPE html>
<html>
    <head>
        <title>unit Test</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="uajsapi/uajsapi.js" type="text/javascript"></script>
    </head>
    <body>
        <script type="text/javascript">
            ua="Mozilla/5.0 (Linux; Android 4.4.4; HM 2A Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 Chitu/1.0.2769 (Xiaomi HM 2A; Android 4.4.4)"
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.4.4");
            assert(uainfo.deviceinfo,"hm 2a");
            assert(uainfo.appinfo.appname,"chitu");
            assert(uainfo.appinfo.appver,"1.0.2769");
            
            ua="Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13D15 MicroMessenger/6.3.8 NetType/WIFI Language/zh_CN";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"ios");
            assert(uainfo.osinfo.osver,"9.2.1");
            assert(uainfo.deviceinfo,"iphone");
            assert(uainfo.appinfo.appname,"wechat");
            assert(uainfo.appinfo.appver,"6.3.8");
            
            ua="Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; NOKIA; Lumia 930) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.10586";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows phone");
            assert(uainfo.osinfo.osver,"10.0");
            assert(uainfo.deviceinfo,"lumia 930");
            assert(uainfo.appinfo.appname,"edge");
            assert(uainfo.appinfo.appver,"13.10586");            
            
            ua="Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/8.0; Touch; rv:11.0; WebBrowser/8.1; IEMobile/11.0; NOKIA; Lumia 630 Dual SIM) like Gecko UCBrowser/4.2.1.541 Mobile";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows phone");
            assert(uainfo.osinfo.osver,"8.1");
            assert(uainfo.deviceinfo,"lumia 630 dual sim");
            assert(uainfo.appinfo.appname,"ucbrowser");
            assert(uainfo.appinfo.appver,"4.2.1.541");
            
            ua="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"macosx");
            assert(uainfo.osinfo.osver,"10.10.2");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"chrome");
            assert(uainfo.appinfo.appver,"44.0.2403.157");            
            
            ua="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows destop");
            assert(uainfo.osinfo.osver,"10.0");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"chrome");
            assert(uainfo.appinfo.appver,"47.0.2526.106");  
            
            ua="Mozilla/5.0 (Linux; U; Android 5.0.2; zh-cn; Redmi Note 2 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/42.0.0.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"5.0.2");
            assert(uainfo.deviceinfo,"redmi note 2");
            assert(uainfo.appinfo.appname,"miuibrowser");
            assert(uainfo.appinfo.appver,"2.1.1");
            
            ua="Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 MxBrowser/4.3.5.2000";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"mxbrowser");
            assert(uainfo.appinfo.appver,"4.3.5.2000");   
            
            ua="Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13D15 Weibo (iPhone8,1__weibo__6.1.0__iphone__os9.2.1)";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"ios");
            assert(uainfo.osinfo.osver,"9.2.1");
            assert(uainfo.deviceinfo,"iphone 6S");
            assert(uainfo.appinfo.appname,"weibo");
            assert(uainfo.appinfo.appver,"6.1.0");           
            
            ua="Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; HM 2A Build/KTU84Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/1.0.0.100 U3/0.8.0 Mobile Safari/534.30 AlipayDefined(nt:WIFI,ws:360|640|2.0) AliApp(AP/9.1.0.091801) AlipayClient/9.1.0.091801 GCanvas/1.4.2.15";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.4.4");
            assert(uainfo.deviceinfo,"hm 2a");
            assert(uainfo.appinfo.appname,"alipay");
            assert(uainfo.appinfo.appver,"9.1.0.091801");
            
            ua="Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; HM 2A Build/KTU84Q) AppleWebKit/533.1 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.4 TBS/025469 Mobile Safari/533.1 V1_AND_SQ_5.9.1_272_YYB_D QQ/5.9.1.2535 NetType/WIFI WebP/0.3.0 Pixel/720";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.4.4");
            assert(uainfo.deviceinfo,"hm 2a");
            assert(uainfo.appinfo.appname,"qq");
            assert(uainfo.appinfo.appver,"5.9.1.2535");      
            
            ua="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.154 Safari/537.36 LBBROWSER";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows destop");
            assert(uainfo.osinfo.osver,"10.0");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"lbbrowser");
            assert(uainfo.appinfo.appver,"LBBROWSER");     
            
            ua="Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0;Ni9u8e";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows destop");
            assert(uainfo.osinfo.osver,"6.2");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"firefox");
            assert(uainfo.appinfo.appver,"21.0");                
            
            ua="Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows destop");
            assert(uainfo.osinfo.osver,"6.2");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"firefox");
            assert(uainfo.appinfo.appver,"21.0"); 
            
            ua="Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/6.4 Mobile Safari/537.36";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"mqqbrowser");
            assert(uainfo.appinfo.appver,"6.4");
            
            ua="Mozilla/5.0 (Linux; Android 4.2.2; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1916.138 Mobile Safari/537.36 T7/6.4 baidubrowser/6.4.14.0 (Baidu; P1 4.2.2)";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"baidubrowser");
            assert(uainfo.appinfo.appver,"6.4.14.0");     

            ua="Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 LieBaoFast/3.27.12";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"liebaofast");
            assert(uainfo.appinfo.appver,"3.27.12");  
            
            ua="Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 Mb2345Browser/7.6.3 Mb2345Browser/7.6.3";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"mb2345browser");
            assert(uainfo.appinfo.appver,"7.6.3");              
            
            ua="Mozilla/5.0 (Linux; Android 4.2.2; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1916.138 Mobile Safari/537.36 T7/6.4";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"chrome");
            assert(uainfo.appinfo.appver,"35.0.1916.138");              
            
            ua="Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; Hol-T00 Build/HUAWEIHol-T00) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 AliApp(DingTalk/2.4.1) com.alibaba.android.rimet/0";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"android");
            assert(uainfo.osinfo.osver,"4.2.2");
            assert(uainfo.deviceinfo,"hol-t00");
            assert(uainfo.appinfo.appname,"dingtalk");
            assert(uainfo.appinfo.appver,"2.4.1");              
            
            ua="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 SE 2.X MetaSr 1.0";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"windows destop");
            assert(uainfo.osinfo.osver,"10.0");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"sogouexplorer");
            assert(uainfo.appinfo.appver,"2.X");                 
        
            ua="Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"xwindow");
            assert(uainfo.osinfo.osver,"X11");
            assert(uainfo.deviceinfo,"");
            assert(uainfo.appinfo.appname,"firefox");
            assert(uainfo.appinfo.appver,"38.0");                   
            
            ua="Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13D15 AliApp(TB/5.5.1)  WindVane/8.0.0 1242x2208";
            uainfo=new UaInfo(ua);
            assert(uainfo.osinfo.osname,"ios");
            assert(uainfo.osinfo.osver,"9.2.1");
            assert(uainfo.deviceinfo,"iphone");
            assert(uainfo.appinfo.appname,"tbapp");
            assert(uainfo.appinfo.appver,"5.5.1");                     
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            document.writeln("all...ok");
            function assert(namea,nameb){
                if(namea === nameb) return true;
                throw new Error(namea+ "!=" + nameb +":出错了！");
            }
        
        </script>
    </body>
</html>
